﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V = Science.Mathematics.VectorCalculus;

namespace VectorCalculus5Ed.Chapter1.Section2
{
    public class Example02
    {
        public Example02()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
            V.Vector v = 2.0 * V.UnitVector.i + 3.0 * V.UnitVector.j - 0.5 * V.UnitVector.k;
         
            V.UnitVector u = new V.UnitVector(v);

            result += u[0].ToString() + "   " +
                u[1].ToString() + "   " + u[2].ToString() + "\r\n";

            double x = 4.0 / Math.Sqrt(53.0);
            double y = 6.0 / Math.Sqrt(53.0);
            double z = -1.0 / Math.Sqrt(53.0);
            result += x.ToString() + "   " +
               y.ToString() + "   " + z.ToString() + "\r\n";

            V.Vector b = 0.5 * V.UnitVector.i + Math.Sqrt(3.0) /2.0 * V.UnitVector.j;
            V.Vector a = V.UnitVector.i;
            V.Vector c = a - b;

            result += c[0].ToString() + "   " +
               c[1].ToString() + "   " + c[2].ToString() + "\r\n";
        }
    }
}

/* 0.549442255794756   0.824163383692134   -0.137360563948689
0.549442255794756   0.824163383692134   -0.137360563948689
0.5   -0.866025403784439   0  */

